<!DOCTYPE html><html><head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="format-detection" content="telephone=no">
    <script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/zepto.js" charset="utf-8"></script>   
	<title>身份信息</title>
    <style type="text/css">
        * {
            outline: none;
            -webkit-tap-highlight-color: rgba(255, 0, 0, 0);
            vertical-align: baseline;
            font-style: normal;
        }

        body {
            margin: 0;
            padding: 0;
            font-size: 12px;
            font-family: Microsoft Yahei, Arial, Simsun, Helvetica, Segoe UI, sans-serif;
            color: #404040;
            background-color: #efeff4;
        }

        img {
            border: 0
        }

        ul, ol, li, dt, dl, dd {
            text-decoration: none;
            list-style: none;
            vertical-align: middle;
            margin: 0;
            padding: 0;
        }

        a,
        a:visited {
            color: #373737;
            text-decoration: none;
        }

        .blank {
            width: 100%;
            height: 20px;
        }
    </style>
</head>

<body>
    <style type="text/css">
        .blank {
            width: 100%;
            height: 20px;
        }

        .userinfoMain {
            width: 100%;
            background-color: #FFF;
            display: table;
        }

        .userinfoMain .userinfoItem {
            width: 96%;
            margin-left: 4%;
            height: 50px;
            line-height: 50px;
        }

        .userinfoMain .userinfoItem span {
            float: left;
            display: block;
            width: 80px;
            height: 50px;
            line-height: 50px;
            text-align: left;
            font-size: 14px;
        }

        .userinfoMain .userinfoItem {
            border-bottom: 1px solid #dbdbdb;
        }

        .userinfoMain .userinfoItem:last-child {
            border-bottom: none;
        }

        .userinfoMain .userinfoItem input {
            width: 210px;
            height: 30px;
            border: none;
            font-size: 14px;
        }

        button {
            width: 94%;
            margin: 0 3%;
            border: none;
            background: #08BA06;
            border-radius: 4px;
            height: 40px;
            line-height: 40px;
            font-size: 18px;
            color: #FFF;
            margin-top: 40px;
            outline: none
        }
    </style>

    <script type="text/javascript">
        $(function () {
            $(".submit").on("click", function() {
                var name = $('input[name="name"]').val();
                var idCode = $('input[name="idCode"]').val();
				var user_id = $('input[name="user_id"]').val();

                if (name == "") {
                    $('#msg').html("请正确填写您的姓名！");
                    return false;
                }

                var reg = /^((11|12|13|14|15|21|22|23|31|32|33|34|35|36|37|41|42|43|44|45|46|50|51|52|53|54|61|62|63|64|65|71|81|82|91)\d{4})((((19|20)(([02468][048])|([13579][26]))0229))|((20[0-9][0-9])|(19[0-9][0-9]))((((0[1-9])|(1[0-2]))((0[1-9])|(1\d)|(2[0-8])))|((((0[1,3-9])|(1[0-2]))(29|30))|(((0[13578])|(1[02]))31))))((\d{3}(x|X))|(\d{4}))$/;
                if (reg.test(idCode) === false) {
                    if(validateTWCard(idCode) === false){
                    	$('#msg').html("请正确填写您的身份证号！");
                        return false;
                    }
                }

				$.ajax({
					type:'post',
					url:'index.php?act=my&op=forgetpwd',
					data:{name:name,idCode:idCode,user_id:user_id},
					dataType:'json',
					success:function(data){
						if(data.state==1){
							location.href = 'index.php?act=my&op=forgetpwds1&user_id='+user_id+'&label='+data.label;
	                        return false;						
						}else{
	                    	$('#msg').html(data.error);
	                        return false;
						}
					}
				});
            });
            //验证台湾身份证号
            function validateTWCard(idCode) {
                var reg = /^[a-zA-Z][0-9]{9}$/;
                if(reg.test(idCode) !== false){
                    var twFirstCode = {"A":10, "B":11, "C":12, "D":13, "E":14, "F":15, "G":16, "H":17, "J":18, "K":19, "L":20, "M":21, "N":22, "P":23, "Q":24, "R":25, "S":26, "T":27, "U":28, "V":29, "X":30, "Y":31, "W":32, "Z":33, "I":34, "O":35};
                    var start = idCode.substring(0, 1);
                    var mid = idCode.substring(1, 9);
                    var end = idCode.substring(9, 10) * 1;
                    var iStart = twFirstCode[start];
                    var sum = parseInt(iStart / 10 + (iStart % 10) * 9);
                    var iflag = 8;
                    for (var c in mid) {
                        sum = sum + mid[c] * iflag;
                        iflag--;
                    }
                    return (sum % 10 == 0 ? 0 : (10 - sum % 10)) == end ? true : false;
                }
                return false;
            }
        });
    </script>

    <div id="contentbox" style="min-height: 576px;">
        <div class="blank"></div>
        <div class="userinfoMain">
            <div class="userinfoItem">
                <span>姓名</span>
                <input name="name" placeholder="填写您的真实姓名">
            </div>
            <div class="userinfoItem">
                <span>身份证号</span>
                <input name="idCode" placeholder="填写您的身份证号" text="<?php echo $output['user']['cardname']?>">
            </div>
            <div class="userinfoItem">
				<font style="color:red" id="msg"></font>
            </div>
        </div>
		<input type="hidden" name="user_id" value="<?php echo $output['user']['user_id'];?>">
        <button class="submit">确 认</button>
    </div>
</body>
</html>